package com.atguigu.gmall.realtime.util

import java.io.InputStreamReader
import java.util.Properties

object MyPropertiesUtil {

    val properties: Properties =  MyPropertiesUtil.load("config.properties")

     def main(args: Array[String]): Unit = {

      println(properties.getProperty("kafka.broker.list"))
    }

    def load(propertiesFileName:String): Properties ={
      val prop=new Properties();
      prop.load(new InputStreamReader(Thread.currentThread().getContextClassLoader.
        getResourceAsStream(propertiesFileName) , "UTF-8"))
      prop


  }
    def getProperty(propertyName:String): String ={
      properties.getProperty(propertyName)
    }



}
